package day09.Ti.HashMapDome;

import java.util.LinkedHashMap;
import java.util.Scanner;

public class Ti22 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入一个字符串");
        String s = sc.nextLine();
        LinkedHashMap<Character,Integer>hm=new LinkedHashMap<>();
        char[] chars = s.toCharArray();
        for (char c : chars) {
            if (!hm.containsKey(c)){
                hm.put(c,1);
            }else {
                int count=hm.get(c)+1;
                hm.put(c,count);
            }
        }
        System.out.println(hm);
    }
}
